﻿using System.Collections.Generic;

namespace Visio.ForwardEngineer.DataModel
{
    /// <summary>
    /// Holds the structure of a column in a table
    /// </summary>
    public class ColumnStructure
    {
        public string Name;         // Name of the column
        public string DataType;     // Data Type, stored as a simple string, makes it easier to build the database
        public bool isNullable;     // Is the column nullable?
    }

    /// <summary>
    /// List of columns
    /// </summary>
    public class ColumnList : Dictionary<string, ColumnStructure>
    {
        /// <summary>
        /// Adds a column indexing it by name
        /// </summary>
        /// <param name="newColumn"></param>
        public void Add(ColumnStructure newColumn)
        {
            this.Add(newColumn.Name, newColumn);
        }
    }
}
